﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace NWSforWEB
{
	// Note: For instructions on enabling IIS6 or IIS7 classic mode, 
	// visit http://go.microsoft.com/?LinkId=9394801

	public class MvcApplication : System.Web.HttpApplication
	{
		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

			routes.MapRoute(
				"GameMarker",                                              // Route name
				"Game/MarkerImage/{gameID}/{ID}",                           // URL with parameters
				new { controller = "Game", action = "MarkerImage", gameID="", id = "" }  // Parameter defaults
			);

			routes.MapRoute(
				"GameMarker2",                                              // Route name
				"Game/MarkerImage/{gameID}/{ID}/{rand}",                   // URL with parameters
				new { controller = "Game", action = "MarkerImage", gameID = "", id = "" }  // Parameter defaults
			);

			routes.MapRoute(
				"mobileImage",                                              // Route name
				"Game/mi/{login}/{password}/{gameName}/{ID}",                   // URL with parameters
				new { controller = "Game", action = "MarkerImage2", gameID = "", id = "" }  // Parameter defaults
			);

			//routes.MapRoute(
			//    "kmzFromSite",                                              // Route name
			//    "Game/m1/{gameID}/{option}",                           // URL with parameters
			//    new { controller = "Game", action = "GMaction1" }  // Parameter defaults
			//);

			routes.MapRoute(
				"mobileCrypt",                                              // Route name
				"Game/m/{encrypted}/{option}",                           // URL with parameters
				new { controller = "Game", action = "GMactionCrypt" }  // Parameter defaults
			);

			routes.MapRoute(
				"mobile",                                              // Route name
				"Game/m/{login}/{password}/{gameName}/{option}",                           // URL with parameters
				new { controller = "Game", action = "GMaction" }  // Parameter defaults
			);

			routes.MapRoute(
				"Default",                                              // Route name
				"{controller}/{action}/{id}",                           // URL with parameters
				new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
			);

		}

		protected void Application_Start()
		{
			RegisterRoutes(RouteTable.Routes);
		}
	}
}